This resource address can be used to create and load CPF pipelines for the specified database.
URL Parameters | |
---|---|
format |
The format of the posted data. Can be either
html , json , or xml (default). This value overrides
the Accept header if both are present.
|
Upon success, MarkLogic Server returns status code 201 (Created). If the pipeline already exists or if the payload is malformed, a status code of 400 (Bad Request) is returned. A status code of 401 (Unauthorized) is returned if the user does not have the necessary privileges.
manage-admin
role, or the
following privilege:
http://marklogic.com/xdmp/privileges/manage
Use the following operation to load the pipelines. This operation loads the
pipelines from the /opt/MarkLogic/Installer
directory. Reapplying
this operation will effectively reinstall cpf pipelines from the current MarkLogic
distribution, which is needed to upgrade pipelines.
{ "operation": "load-default-cpf-pipelines" }The structure of the data in the request body to create a new pipeline is as follows.
annotation
pipeline-id
pipeline-name
pipeline-description
success-action
failure-action
status-transition
This is a complex structure with the following children:
annotation
status
on-success
on-failure
priority
always
default-action
execute
This is a complex structure with the following children:
annotation
condition
action
state-transition
This is a complex structure with the following children:
annotation
state
on-success
on-failure
priority
always
default-action
execute
This is a complex structure with the following children:
annotation
condition
action
event-transition
This is a complex structure with the following children:
annotation
event
priority
default-action
execute
This is a complex structure with the following children:
annotation
condition
action
cat pipeline.json ==> { "pipeline-name": "Status Change Handling", "pipeline-description": "Out-of-the-box document status handling.", "success-action": { "module": "/MarkLogic/cpf/actions/success-action.xqy" }, "failure-action": { "module": "/marklogic/cpf/actions/failure-action.xqy" }, "status-transition": [ { "annotation": "", "status": "created", "on-success": "http://marklogic.com/states/initial", "priority": 100, "default-action": { "module": "/marklogic/cpf/actions/set-updated-action.xqy" }, "execute": [ { "condition": { "module": "/marklogic/cpf/actions/changed-type-condition.xqy" }, "action": { "module": "/marklogic/cpf/actions/success-action.xqy" } }, { "condition": { "module": "/MarkLogic/cpf/actions/renamed-links-condition.xqy" }, "action": { "module": "/MarkLogic/cpf/actions/link-rename-action.xqy" } }, { "condition": { "module": "/MarkLogic/cpf/actions/existing-state-condition.xqy" }, "action": { "module": "/MarkLogic/cpf/actions/touch-state-action.xqy" } } ] } ] } curl -X POST --anyauth --user admin:admin \ --header "Content-Type:application/json" -d@pipeline.json \ http://localhost:8002/manage/v2/databases/Triggers/pipelines?format=json ==> Creates a new pipeline, named "Status Change Handling," in the Triggers database.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.